package com.bw.demo.adapter

import android.view.View
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bw.demo.R
import com.bw.demo.entity.VideoEntity
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.shuyu.gsyvideoplayer.utils.GSYVideoType
import com.shuyu.gsyvideoplayer.video.StandardGSYVideoPlayer

class VideoAdapter (list: MutableList<VideoEntity>) : BaseQuickAdapter<VideoEntity,BaseViewHolder>(R.layout.video_item,list){
    override fun convert(holder: BaseViewHolder, item: VideoEntity) {
        Glide.with(context).load(item.image_url).into(holder.getView(R.id.iv_video))
        holder.setText(R.id.tv1_video,item.name)
        holder.setText(R.id.tv2_video,item.description)


//        val gsy = holder.getView<StandardGSYVideoPlayer>(R.id.gsy)
//        //val gsy = holder.getView<StandardGSYVideoPlayer>(R.id.gsy)
        Glide.with(context).load(item.videomainimag).into(holder.getView(R.id.iv_video_bofang))
//        gsy.setUp(item.videopath,true,"")



        //val image = holder.getView<ImageView>(R.id.iv_video_bofang)
        holder.getView<StandardGSYVideoPlayer>(R.id.gsy)



    }

}